﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data;

namespace BO
{
    [Serializable]
    public class SerSqlParameter
    {
        public SerSqlParameter(SqlParameter sPara)
        {
            this.paraName = sPara.ParameterName;
            this.paraLen = sPara.Size;
            this.paraVal = sPara.Value;
            this.sqlDbType = sPara.SqlDbType;
        }
        public SerSqlParameter(string pName, object pValue)
        {
            this.paraName = pName;
            this.paraVal = pValue;
        }

        public SqlParameter ToSqlParameter()
        {
            SqlParameter para = new SqlParameter(this.paraName, this.sqlDbType, this.paraLen);
            para.Value = this.paraVal;
            return para;
        }

        private string paraName = "";
        public string ParaName
        {
            get { return this.paraName; }
            set { this.paraName = value; }

        }

        private int paraLen = 0;
        public int ParaLen
        {

            get { return this.paraLen; }
            set { this.paraLen = value; }
        }

        private object paraVal = null;
        public object ParaVal
        {
            get { return this.paraVal; }
            set { this.paraVal = value; }
        }

        private SqlDbType sqlDbType = SqlDbType.NVarChar;
        public SqlDbType SqlDbType
        {
            get { return this.sqlDbType; }

            set { this.sqlDbType = value; }
        }
    }

}
